<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bai 3.13</title>
</head>

<body>
<?php
	$mang_dl=array();
	$mang_dl=array(array(ma=>"ti",ten=>"Tuổi tí",hinh=>"ti.gif"),
						 array(ma=>"suu",ten=>"Tuổi sửu",hinh=>"suu.gif"),
						 array(ma=>"dan",ten=>"Tuổi dần",hinh=>"dan.gif"),
						 array(ma=>"mao",ten=>"Tuổi mão",hinh=>"mao.gif"),
						 array(ma=>"thin",ten=>"Tuổi thìn",hinh=>"thin.gif"),
						 array(ma=>"ty",ten=>"Tuổi tỵ",hinh=>"ty.gif"),);
	$mang="";
	function compare($a,$b)
	{
		if($a["ma"]=$b["ma"]) return 0;
		return ($a["ma"]<$b["ma"])?-1:1;
	}
	usort($mang_dl,"compare");
	foreach($mang_dl as $mot_dl)
	{
		
		$ma=$mot_dl["ma"];
		$ten=$mot_dl["ten"];
		$mang.="<a href='#$ma'>$ten</a><br />";
	}
	
	$noidung="";
	foreach($mang_dl as $mot_dl)
	{
		$ma=$mot_dl["ma"];
		$ten=$mot_dl["ten"];
		$link="<a name='$ma'></a>";
		$tenhinh=$mot_dl["hinh"];
		$hinh="<img src='images/$tenhinh'/>";
		$noidung.="<p align='center'>$link<br /><b>$ten</b><br />$hinh<br /><a href=#top>Quay về đầu trang</a></p>";
	}
?>
<form id="form1" name="form1" method="post" action="Bai3_13.php">
  <table bgcolor="#CC9966" width="800" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr bgcolor="#666600" style="text-align: center; font-size: 24px; color: #FFF; font-weight: bold; font-style: italic;">
      <td colspan="2"><a name="top" id="top"></a>DANH LAM THẮNG CẢNH</td>
    </tr>
    <tr>
      <td style="font-weight: bold">Danh sách địa danh</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td valign="top" align="left"><?php echo $mang;?></td>
      <td><?php echo $noidung;?></td>
    </tr>
  </table>
</form>
</body>
</html>